summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgather.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/gather.py b/gather.py
index 795c409..5950363 100755
--- a/gather.py
+++ b/gather.py
@@ -24,7 +24,7 @@ Base = declarative_base()
class Book(Base):
__tablename__ = "books"
- isbn = Column(BigInteger, primary_key=True, nullable=False, doc="book isbn. found in URL http://www/isbn/987 and in acsm: resource, dc:identifier (sometimes not), thumbnailURL")
+ isbn = Column(BigInteger, primary_key=True, nullable=False, doc="book isbn. found in URL http://www/isbn/978 and in acsm: resource, dc:identifier (sometimes not), thumbnailURL")
title = Column(String, nullable=True, doc="title of the book, dcc:title in acsm")
creator = Column(String, nullable=True, doc="author of the book, dc:creator in acsm")
publisher = Column(String, nullable=True, doc="publisher of the book, dc:publisher in acsm")
@@ -98,8 +98,8 @@ try:
elif r.text.startswith("Napaka pri prenosu"):
logger.warning(f"'napaka pri prenosu' received from http for acsm id {acsm_id}, skipping")
force_acsm_id = acsm_id+1
- elif r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_SUCH_RESOURCE resid urn:uuid:00000000-1002-0000-0009-78') or r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_DISTRIBUTION_RIGHTS urn:uuid:00000000-1002-0000-0009-78'):
- isbn = int([x for x in r.text.split() if x.startswith("urn:uuid:00000000-1002-0000-0009-78")][0].split("-").pop())+int(9e12)
+ elif r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_SUCH_RESOURCE resid urn:uuid:00000000-1002-0000-0009-') or r.text.startswith('<error xmlns="http://ns.adobe.com/adept" data="E_URLLINK_NO_DISTRIBUTION_RIGHTS urn:uuid:00000000-1002-0000-0009-'):
+ isbn = int([x for x in r.text.split() if x.startswith("urn:uuid:00000000-1002-0000-0009-")][0].split("-").pop())+int(9e12)
borrow = Borrow(id=acsm_id, isbn=isbn, obtained=int(time()))
logger.warning(f"received either 'no such resource' or 'no distribution rights' from server and stored a quite empty {borrow}")
session.add(borrow)